package com.whfc.ms.api.base.service;

import com.whfc.base.dto.MsgRecordDTO;
import com.whfc.base.dto.MsgStatisticsDTO;
import com.whfc.base.param.WarnMsgSearchParam;
import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.common.result.PageVO;
import com.whfc.entity.dto.msg.AppMsgNumDTO;
import com.whfc.entity.dto.msg.AppMsgToUserDTO;
import com.whfc.entity.dto.msg.AppWarnMsgDTO;
import com.whfc.entity.param.msg.AppMsgDelAllParam;
import com.whfc.entity.param.msg.AppMsgDelParam;
import com.whfc.entity.param.msg.AppMsgReadAllParam;
import com.whfc.entity.param.msg.AppMsgReadParam;
import com.whfc.fuum.entity.SysUser;

import java.util.List;
import java.util.Map;

/**
 * @author sun_guodong
 * @description 消息管理
 * @date 2019-12-05
 */
public interface AppMessageService {

    /**
     * 获取可供选择的接收消息用户列表
     *
     * @param deptId
     * @return
     */
    ListData<AppMsgToUserDTO> getAvailableRecUsers(Integer deptId);

    /**
     * 首页消息列表
     *
     * @param user
     * @param pageNum
     * @param pageSize
     * @param deptId
     * @param state
     * @param moduleType
     * @return
     */
    PageData<AppWarnMsgDTO> list(SysUser user, Integer pageNum, Integer pageSize, Integer deptId, Integer state, Integer moduleType);

    /**
     * 获取未读消息数
     *
     * @param user
     * @param deptId
     * @return
     */
    AppMsgNumDTO getUnreadMsgNum(SysUser user, Integer deptId);

    /**
     * 删除消息
     *
     * @param request
     */
    void del(AppMsgDelParam request);

    /**
     * 删除所有消息
     *
     * @param user
     * @param request
     */
    void delAll(SysUser user, AppMsgDelAllParam request);

    /**
     * 将消息设置为已读
     *
     * @param request
     */
    void read(AppMsgReadParam request);

    /**
     * 标记读取所有消息
     *
     * @param user
     * @param request
     */
    void readAll(SysUser user, AppMsgReadAllParam request);

    /**
     * 首页-获取最新的待我审批
     * @param userId
     * @return
     */
    Map getNewApproveWithMe(Integer userId,Integer deptId);

    List<MsgStatisticsDTO> getWarnMsgStatistics(Integer deptId, Integer warnType, Integer userId);

    PageVO<MsgRecordDTO> getWarnMsgPage(WarnMsgSearchParam param);
}
